This page last changed on Aug 03, 2008 by scytacki.

Overview

This details how to make a Jnlp Servlet war which mirrors an existing set of jnlps and jars. The resulting war will contain the servlet and the jnlps and jars copied from another location. The mirroring process takes as input one or more jnlp urls. Those jnlps plus all of the jars and extension jnlps referenced by them are copied into the war.

If you want to build these jnlp and jars from source then you should follow the directions on this page: Setup JNLP Deployment Environment

Steps

  1. setup directories
  2. download and unzip a initial war file with jnlp-servlet jar and the web.xml
  3. download a java program JnlpServletCacher for installing a jnlp with its jars into the webapp
  4. run JnlpServletCacher with the urls to the jnlps and the directory where to save the resources
  5. create the war file

Script

mkdir -p jnlp-servlet-work/jnlp-servlet; cd jnlp-servlet-work/jnlp-servlet                                
curl http://confluence.concord.org/download/attachments/16444/empty-jnlp-servlet.war | jar x              
curl http://jnlp.concord.org/dev/org/concord/jnlp2shell/jnlp2shell-1.0-SNAPSHOT.jar > ../jnlp2shell.jar    
SERVLET_JNLPS=" 
  http://jnlp.concord.org/dev/org/concord/maven-jnlp/udl-otrunk/udl-otrunk.jnlp  
  http://jnlp.concord.org/dev/org/concord/maven-jnlp/capa-otrunk/capa-otrunk.jnlp" 
for jnlp_url in $SERVLET_JNLPS 
do  
  java -cp ../jnlp2shell.jar org.concord.JnlpServletCacher $jnlp_url .
done 
jar cf ../jnlp-servlet.war .

This creates a dir called jnlp-servlet-work and creates inside it a deployable war file (and the expanded directory) and in the case above populates with the following jnlps and all of their associated resources:

If you are going to run this a lot then you probably want to

  • save this script as a file,
  • add the special shell script line on the top:
    #!/bin/bash
  • make it executable:
    chmod a+x [file_name]
  • make sure the list of jnlps is correct

empty-jnlp-servlet.war (application/octet-stream)
Document generated by Confluence on Jan 27, 2014 16:56